//logs.js
var util = require('../../utils/util.js')
var mpage = 1
Page({
    data: {
        goodsList: null,
        styleImag: null
    },
    onLoad: function (params) {
      let id=params.styleId;
      var url=null;
      console.log("id为------->"+id)
        console.log(params)
        if(id==1){
          url ="https://img.magicmanufactory.com/image/suitStyle/classic.jpg"
        }else if(id==8){
          url = "https://img.magicmanufactory.com/image/suitStyle/morden.jpg"
        }else if(id==2){
          url = "https://img.magicmanufactory.com/image/suitStyle/vogue.jpg"
        }else{
          url = "https://img.magicmanufactory.com/image/suitStyle/grace.jpg"
        }
        var that = this;
        var murl = `/c2mwebservice/api/v2/public/index/style/${params.categoryId}/${params.styleId}?page=${mpage}&rows=20`;
        console.log("**********murl*************"+ murl);
        //请求数据
        util.request(murl, function (dataJson) {
            that.setData({
                goodsList: dataJson.returnData.goodsList.rows,
                // styleImag: dataJson.returnData.styleImage,
                styleImag:url ,

                loadingHidden: true
            })
        }, function (res) {
            wx.showToast({
                title: res,
                duration: 2000
            })
        });
    },

    onShow: function () {
        console.log(this.data)

    },
    onShareAppMessage: function () {
        return {
            title: 'Cotte',
            desc: '酷特智能'
        }
    }
})

